package com.jbm.onehome.iface;

import com.jbm.core.iface.IAcross;

import javax.persistence.*;
import java.sql.Timestamp;
import java.util.List;

/**
 * Created by Administrator on 2017/8/21.
 */
@Entity
@Table(name = "visitlogs", schema = "", catalog = "jbmcore")
@org.hibernate.annotations.Entity(dynamicUpdate=true,dynamicInsert=true)
public class VisitlogsEntity extends IAcross
{
    public VisitlogsEntity()
    {
        super();
    }

    public VisitlogsEntity(IAcross ia)
    {
        super(ia);
    }
    private int vlId;
    private Integer orderId;
    private String memo;
    private Integer createId;
    private Timestamp createDate;
    private List<VisitlogsEntity> visitlogsEntities;

    public VisitlogsEntity(int orderId)
    {
        this.orderId=orderId;
    }
    @Id
    @Column(name = "vl_id")
    @GeneratedValue
    public int getVlId() {
        return vlId;
    }

    public void setVlId(int vlId) {
        this.vlId = vlId;
    }

    @Basic
    @Column(name = "order_id")
    public Integer getOrderId() {
        return orderId;
    }

    public void setOrderId(Integer orderId) {
        this.orderId = orderId;
    }

    @Basic
    @Column(name = "memo")
    public String getMemo() {
        return memo;
    }

    public void setMemo(String memo) {
        this.memo = memo;
    }

    @Basic
    @Column(name = "create_id")
    public Integer getCreateId() {
        return createId;
    }

    public void setCreateId(Integer createId) {
        this.createId = createId;
    }

    @Basic
    @Column(name = "create_date")
    public Timestamp getCreateDate() {
        return createDate;
    }

    public void setCreateDate(Timestamp createDate) {
        this.createDate = createDate;
    }

    @Override
    public boolean equals(Object o) {
        if (this == o) return true;
        if (o == null || getClass() != o.getClass()) return false;

        VisitlogsEntity that = (VisitlogsEntity) o;

        if (vlId != that.vlId) return false;
        if (createDate != null ? !createDate.equals(that.createDate) : that.createDate != null) return false;
        if (createId != null ? !createId.equals(that.createId) : that.createId != null) return false;
        if (memo != null ? !memo.equals(that.memo) : that.memo != null) return false;
        if (orderId != null ? !orderId.equals(that.orderId) : that.orderId != null) return false;

        return true;
    }

    @Override
    public int hashCode() {
        int result = vlId;
        result = 31 * result + (orderId != null ? orderId.hashCode() : 0);
        result = 31 * result + (memo != null ? memo.hashCode() : 0);
        result = 31 * result + (createId != null ? createId.hashCode() : 0);
        result = 31 * result + (createDate != null ? createDate.hashCode() : 0);
        return result;
    }
@Transient
    public List<VisitlogsEntity> getVisitlogsEntities() {
        return visitlogsEntities;
    }

    public void setVisitlogsEntities(List<VisitlogsEntity> visitlogsEntities) {
        this.visitlogsEntities = visitlogsEntities;
    }
}
